package com.tjetc.utils;

import java.util.Arrays;

/**
 * @Author: itda
 * @Date: 2024/5/9 14:13
 * @Description: CloseResources
 */
public class CloseResources {
    public static void close(AutoCloseable... closeables){
        if (closeables != null) {
            Arrays.stream(closeables).forEach(autoCloseable -> {
                if (autoCloseable != null) {
                    try {
                        autoCloseable.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        }
    }
}
